home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / filesystem.squashfs / bin / autopartition < prev    next >
Text File  |  2009-07-14  |  1KB  |  41 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/base.sh
  4. . /lib/partman/lib/recipes.sh
  5. . /lib/partman/lib/auto-shared.sh
  6.  
  7. dev=$1
  8. cd $dev
  9.  
  10. [ -f size ] || exit 1
  11. size=$(cat size)
  12. target="$(humandev $(cat device)) - $(cat model)"
  13.  
  14. if [ -z "$2" ]; then
  15.     # Only one parameter. Being run for initial autopartitioning.
  16.     target="$target: $(longint2human $size)"
  17.     free_size=$(convert_to_megabytes $size)
  18.  
  19.     choose_recipe default "$target" "$free_size" || exit $?
  20.  
  21.     auto_init_disks "$dev" || exit $?
  22.     get_last_free_partition_infos $dev
  23. else
  24.     # Two parameters, being run on selected free space.
  25.     free_space=$2
  26.  
  27.     open_dialog PARTITION_INFO $free_space
  28.     read_line x1 x2 free_size x3 x4 x5 x6
  29.     close_dialog
  30.  
  31.     target="$target: $(longint2human $free_size) ($(longint2human $size))"
  32.     free_size=$(convert_to_megabytes $free_size)
  33.  
  34.     choose_recipe default "$target" "$free_size" || exit $?
  35. fi
  36.  
  37. perform_recipe $dev $free_space $recipe || exit $?
  38.  
  39. # default to accepting the autopartitioning
  40. menudir_default_choice /lib/partman/choose_partition finish finish || true
  41.